from . import __version__ as app_version

app_name = "zelin_subcontract"
app_title = "Subcontract"
app_publisher = "szufisher"
app_description = "Subcontract Enhancement"
app_email = "yuxinyong@163.com"
app_license = "MIT"

doctype_js = {
    "Item":"public/js/item.js",
    "Purchase Order" : "public/js/purchase_order.js",
    "Subcontracting Receipt": "public/js/subcontracting_receipt.js"}

fixtures = [
    {
        "doctype": "Property Setter",
        "filters": [
            [
                "name",
                "in",
                (
                    "Subcontracting Receipt-main-links_order",
                ),
            ]
        ],
    }
]

override_doctype_class = {
	"Bin": "zelin_subcontract.overrides.CustomBin"
}

override_whitelisted_methods = {
	"erpnext.subcontracting.doctype.subcontracting_order.subcontracting_order.update_subcontracting_order_status":
        "zelin_subcontract.overrides.custom_update_subcontracting_order_status"
}

doc_events = {
 	"Purchase Order": {
 		"before_insert": "zelin_subcontract.doc_events.purchase_order_update_service_item"
	},
    "Subcontracting Receipt": {
 		"validate": "zelin_subcontract.doc_events.subcontracting_receipt_poi_expense_account",
        "on_submit": "zelin_subcontract.doc_events.update_reserved_qty_for_sub_contract",
        "on_cancel": "zelin_subcontract.doc_events.update_reserved_qty_for_sub_contract"
	},
    "Stock Entry": {
        "on_submit": "zelin_subcontract.doc_events.update_reserved_qty_for_sub_contract",
        "on_cancel": "zelin_subcontract.doc_events.update_reserved_qty_for_sub_contract"
	},
    "Subcontracting Order": {
        "validate": "zelin_subcontract.doc_events.subcontracting_order_update_net_rate",
        "on_submit": "zelin_subcontract.doc_events.update_reserved_qty_for_sub_contract",
        "on_cancel": "zelin_subcontract.doc_events.update_reserved_qty_for_sub_contract"
	}
}

override_doctype_dashboards = {
	"Subcontracting Receipt": "zelin_subcontract.overrides.override_subcontracting_receipt_dashboard",
}